#!python3
import pyautogui
print('press ctrl+C to quit')
try:
    while True:
        x,y=pyautogui.position()
        posStr='X:'+str(x).ljust(4)+' Y:'+str(y).ljust(4)
        print(posStr,end='')
        print("\b"*len(posStr),end='',flush=True)
       # print('\r'+''*len(posStr)+'\r',end='',flush=True)
except KeyboardInterrupt:
    print('\nDone')
